﻿using System;
using System.Collections.Generic;
using System.Text;


    class Zerg
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            List<string> numbers = new List<string>();
            StringBuilder number = new StringBuilder();
            int digitLength = 3;

            for (int i = 0; i < input.Length; i++)
            {
                number.Append(input[i]);
                if (i == digitLength)
                {
                    numbers.Add(number.ToString());
                    digitLength += 4;
                    number.Clear();
                }
            }
            double result = ConvertToDecimal(numbers);
            Console.WriteLine(result);
        }
  static double ConvertToDecimal (List<string> numbers)
        {
            double decimNumber = 0;
            for (int i = 0; i < numbers.Count; i++)
            {
                switch (numbers[i])
                {
                    case "Rawr": decimNumber += 0 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Rrrr": decimNumber += 1 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Hsst": decimNumber += 2 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Ssst": decimNumber += 3 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Grrr": decimNumber += 4 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Rarr": decimNumber += 5 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Mrrr": decimNumber += 6 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Psst": decimNumber += 7 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Uaah": decimNumber += 8 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Uaha": decimNumber += 9 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Zzzz": decimNumber += 10 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Bauu": decimNumber += 11 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Djav": decimNumber += 12 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Myau": decimNumber += 13 * Math.Pow(15, numbers.Count - 1 - i); break;
                    case "Gruh": decimNumber += 14 * Math.Pow(15, numbers.Count - 1 - i); break;
                }

            }
            return decimNumber;

        }
    }

